/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.menosehmais.persistence;

import br.com.caelum.vraptor.ioc.Component;
import br.com.menosehmais.framework.persistence.DaoJpa2;
import br.com.menosehmais.model.PortletDO;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.TypedQuery;

/**
 *
 * @author Junior JAFJ
 */
@Component
public class PortletDAO extends DaoJpa2<PortletDO> {
    
    public PortletDAO(EntityManager em) {
        super(PortletDO.class, em);
    }
    
    public List<PortletDO> consultarPortlets() {
        String jpql = "SELECT p FROM PortletDO p";
        TypedQuery<PortletDO> query = entityManager.createQuery(jpql, PortletDO.class);        
        return query.getResultList();
    }
}
